<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of siteController
 *
 * @author SG11048
 */
if(!defined("STDCALL")) die("Direct call not allowed");

class siteController {

    public function loadView($view,array $data=null) {
        global $folder;
        $file = SERVER_ROOT . 'app/' . $folder . '/v/' . $view . '.php';
        if (file_exists($file)) {
            //get file
            include_once($file);
        } else {
            //file does not exist!
            die("File '$filename' containing class '$className' not found. file " . $file);
        }
    }
    
    public function redirectPage($appFolder,$controller,$variable=null,$values=null) {
        if($variable!=null) $target = SITE_ROOT."/?$appFolder/$controller/$variable=$values";
        else $target = SITE_ROOT."/?$appFolder/$controller/";
        header("location:".$target);
    }
}

?>
